<?php
namespace App\Api\V1\Models;

use Illuminate\Database\Eloquent\Model;

class Topic extends Model
{
    protected $table = 'topic';
    public $timestamps = false;
    public function addTopicItem(){
        $ds = [
            'topic_id' => '225',
            'title' => '南京长江啦啦啦啦啦',
            'alias' => '别名啦啦啦啦啦啦啦阿拉啦啦啦拉拉',
            'content' => '内容',
            'keywords' => '关键词',
            'description' => '描述描述描述描述描述',
            'status' => '2',
        ];

        $this->topic_id = $ds['topic_id'];
        $this->title = $ds['title'];
        $this->alias = $ds['alias'];
        $this->content = $ds['content'];
        $this->keywords = $ds['keywords'];
        $this->description = $ds['description'];
        $this->status = $ds['status'];

        if($this->save()){
            return $this->toArray();
        }
        return false;
    }

    public function delTopicList(){
        return '我是批量删除专题';
    }

    public function getTopicItem(){
        return '我是获取一个专题';
    }

    public function getTopicList(){
        return '我是获取专题列表';
    }

    public function setTopicItem()
    {
        return '我是编辑一个专题';
    }

    public function setTopicStatus(){
        return '我是批量设置标题是否显示';
    }
}
